/*
 * This file is part of b.AMP.
 *
 * b.AMP is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * b.AMP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with b.AMP.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __DATA_INPUT_TEST_HPP__
#define __DATA_INPUT_TEST_HPP__

#include <bamp/data_input_ptr.hpp>
#include <bamp/noncopyable.hpp>

#include <cstddef>
#include <string>
#include <vector>

class DataInputTest: public bamp::DataInput, bamp::Noncopyable
{
public:

    DataInputTest();
    virtual ~DataInputTest();

    // Plugin interface

    BAMP_DATA_INPUT_DEFINE_CLONE_NOT_IMPLEMENTED;

    virtual void open(const std::string& url);
    virtual void close();
    virtual std::string getType() const;
    virtual void setHost(bamp::HostPtr host);
    virtual void send(bamp::MessagePtr msg);
    virtual size_t getPosition() const;
    virtual void setPosition(size_t position);
    virtual bool getSeekable() const;
    virtual bamp::Status read(char* dst, size_t& size);


private:

    // Current file
    size_t      m_pos;
    size_t      m_size;
    std::string m_name;
    std::string m_type;
    bool        m_isOpen;

    // Host object
    bamp::HostPtr m_host;
};

#endif // __DATA_INPUT_TEST_HPP__
